package chapter03;

public class Test05_Ball {
    public static void main(String[] args) {
        BasketBall b = new BasketBall("牛皮");
        b.play();
        FootBall f = new FootBall("高级材料");
        f.play();
    }
}
abstract class Ball{
    private String material;
    abstract public void play();
    public Ball(String material){
        this.material = material;
    }
}
class BasketBall extends Ball{
    public BasketBall(String material) {
        super(material);
    }

    @Override
    public void play() {
        System.out.println("玩篮球");
    }
}
class FootBall extends Ball{
    public FootBall(String material) {
        super(material);
    }

    @Override
    public void play() {
        System.out.println("踢足球");
    }
}
